home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 015a / vaxutils.zip / LASER.COM < prev    next >
Text File  |  1988-04-12  |  4KB  |  108 lines

  1. $!******************************************************************************
  2. $! LASER.COM
  3. $!
  4. $!   Copyright 1987 by:   David Blanchard
  5. $!              NOAA/Weather Research Program
  6. $!              Boulder, Colorado
  7. $!
  8. $! (Unlimited distribution permitted as long as above copyright remain intact)
  9. $!
  10. $!
  11. $!******************************************************************************
  12. $! @LASER P1 P2 P3
  13. $! Procedure to print on the LN03 printer
  14. $! P1 is the file to be printed
  15. $! P2 is the orientation...landscape/portrait
  16. $! P3 is the font
  17. $
  18. $!******************************************************************************
  19. $! Define some escape sequences
  20. $
  21. $ ESC[0,8] = 27
  22. $ FF[0,8]  = 12
  23. $
  24. $!******************************************************************************
  25. $ON ERROR THEN GOTO ERR
  26. $
  27. $! If Parameters 1, 2 or 3 are missing, prompt the user for the values
  28. $If P1 .EQS. "" THEN GOTO PROMPT
  29. $If P2 .EQS. "" THEN GOTO PROMPT
  30. $If P3 .EQS. "" THEN GOTO PROMPT
  31. $
  32. $!  All parameters present...go to directory name
  33. $
  34. $Goto DIRNAME
  35. $
  36. $!******************************************************************************
  37. $PROMPT:
  38. $COPY SYS$INPUT SYS$OUTPUT
  39. <Usage:>  LASER P1 P2 P3   <no prompts>
  40.     or      LASER        <with prompts>
  41.  
  42. P1 is the name of the text file to be printed
  43. P2 is the orientation of the printed page
  44.    = 1    Portrait mode        (P3 = 1,2, or 3)
  45.    = 2    Landscape mode        (P3 = 1,2, or 3)
  46.    = 3    Tektronix 4014 mode (P3 = 8,9, or 0)
  47. P3 is the font style to be used
  48.    = 1    Courier  6.7 point, 13.6 pitch, 66 lines/page
  49.    = 2    Courier   10 point,   10 pitch, 48 lines/page
  50.    = 3    Elite      10 point,   12 pitch, 48 lines/page
  51.    = 8    ModGothic 14 point,  7.1 pitch, 35 lines/page
  52.    = 9    ModGothic 14 point,  7.9 pitch, 39 lines/page
  53.    = 0    Courier  6.7 point,   12 pitch, 58 lines/page
  54.  
  55.             WARNING!!!
  56. If you select P2=3, then DO NOT abort the print cycle unless you
  57. plan to do either a software or hardware reset of the LN03.
  58.  
  59. $!******************************************************************************
  60. $Inquire/NoPunc P1 "_File Name:  "
  61. $Inquire/NoPunc P2 "_Orientation:  "
  62. $Inquire/NoPunc P3 "_Font:  "
  63. $
  64. $If P1 .EQS. "" .OR. P2 .EQS. "" .OR. P3 .EQS. "" THEN GOTO PROMPT
  65. $
  66. $!******************************************************************************
  67. $! Determine the current directory name
  68. $DIRNAME:
  69. $
  70. $DIR = F$DIRECTORY()
  71. $
  72. $!******************************************************************************
  73. $! Open file for escape sequence to set mode and font style
  74. $Open/Write/Error=LABEL1 SET_MODE TEMP001.ESC
  75. $IF P2 .EQS. 1 THEN WRITE SET_MODE ESC,"[?20 J"     !Portrait mode
  76. $IF P2 .EQS. 2 THEN WRITE SET_MODE ESC,"[?21 J"     !Landscape mode
  77. $IF P2 .EQS. 3 THEN WRITE SET_MODE ESC,"[?38h",ESC,FF    !4014 mode
  78. $
  79. $IF P3 .EQS. 1 THEN WRITE SET_MODE ESC,"[15m"
  80. $IF P3 .EQS. 2 THEN WRITE SET_MODE ESC,"[13m"
  81. $IF P3 .EQS. 3 THEN WRITE SET_MODE ESC,"[14m"
  82. $IF P3 .EQS. 8 THEN WRITE SET_MODE ESC,"8"
  83. $IF P3 .EQS. 9 THEN WRITE SET_MODE ESC,"9"
  84. $IF P3 .EQS. 0 THEN WRITE SET_MODE FF,ESC,":"
  85. $CLOSE SET_MODE
  86. $
  87. $!******************************************************************************
  88. $! Open file for escape sequence to reset to portrait mode
  89. $
  90. $OPEN/WRITE/ERROR=LABEL1 RESET_MODE TEMP002.ESC
  91. $IF P2 .EQ. 3 THEN WRITE RESET_MODE ESC,"[?38l"
  92. $WRITE RESET_MODE ESC,"[!p"
  93. $CLOSE RESET_MODE
  94. $
  95. $!******************************************************************************
  96. $! Print the file and delete the escape sequence files
  97. $
  98. $PRINT/QUE=TXC3:/NAME='P1' 'DIR'TEMP001.ESC/DELETE,-
  99.                            'P1',-
  100.                            'DIR'TEMP002.ESC/DELETE
  101. $EXIT
  102. $
  103. $!******************************************************************************
  104. $ERR:
  105. $Print/Queue=TXC3: TEMP002.ESC/DELETE
  106. $EXIT
  107.